package com.lagou.cluster.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @ClassName IndexController
 * @Description 首页控制器
 * @Author playboy
 * @Date 2021/5/25 9:40 下午
 * @Version 1.0
 **/
@RequestMapping
@Controller
public class IndexController {
	private static Logger log = LoggerFactory.getLogger(IndexController.class);


	/**
	 * 跳转到首页
	 *
	 * @param model
	 * @param session
	 * @return
	 */
	@RequestMapping("/index")
	public String index(Model model, HttpSession session, HttpServletRequest request) {
		model.addAttribute("port", request.getLocalPort());
		model.addAttribute("sessionid", session.getId());
		return "index";
	}

}
